package org.metasketch.simulator.petri;

import java.util.ArrayList;
import java.util.List;

import org.metasketch.simulator.resources.ResourceRequirements;
import org.metasketch.simulator.resources.ResourceRequirementsMap;

public class Transition extends PetriNetNode {

	ResourceRequirementsMap requirements = new ResourceRequirementsMap();

	List<Place> inputPlaces = new ArrayList<Place>();
	List<Place> outputPlaces = new ArrayList<Place>();

	// @Override
	// public void compile() throws Exception {
	// // TODO Auto-generated method stub
	//
	// for (Link in : inputs) {
	// PetriNetNode node = in.getSource();
	// if (node instanceof Place) {
	// inputPlaces.add((Place) node);
	// } else
	// throw new Exception(
	// "Input link to a Transition has a node that is not a Place !!! "
	// + node.getClass());
	// }
	//
	// for (Link in : outputs) {
	// PetriNetNode node = in.getSource();
	// if (node instanceof Place) {
	// outputPlaces.add((Place) node);
	// } else
	// throw new Exception(
	// "Output link from a Transition has a node that is not a Place !!! "
	// + node.getClass());
	// }
	//
	// }

	public List<Place> getInputPlaces() {
		return inputPlaces;
	}

	public void setInputPlaces(List<Place> inputPlaces) {
		this.inputPlaces = inputPlaces;
	}

	public List<Place> getOutputPlaces() {
		return outputPlaces;
	}

	public void setOutputPlaces(List<Place> outputPlaces) {
		this.outputPlaces = outputPlaces;
	}

	public ResourceRequirementsMap getRequirements() {
		return requirements;
	}

	public void setRequirements(ResourceRequirementsMap requirements) {
		this.requirements = requirements;
	}

}
